from tkinter.simpledialog import Dialog
from tkinter.scrolledtext import ScrolledText
from typing import List


class DevicesDialog(Dialog):
    def __init__(self, parent, devices: List[str]):
        self._devices = devices
        super().__init__(parent, title='Devices already finished backup')

    def body(self, master) -> None:
        devices = ScrolledText(master)
        devices.pack()

        for device in self._devices:
            devices.insert('end', '%s\n' % device)
